home *** CD-ROM | disk | FTP | other *** search
/ The History of Denim / The History of Denim.iso / pc / nav.dir / 00002_Handlers.ls < prev    next >
Encoding:
Text File  |  1997-11-14  |  2.7 KB  |  83 lines

  1. on WindowFunctions
  2.   global moving, MouseMGR
  3.   if the memberNum of sprite 1 = the memberNum of member "navpal" then
  4.     set Check to rect(344, 0, 388, 19)
  5.     set NewMember to the memberNum of member "nav_zip"
  6.   else
  7.     set Check to rect(0, 0, 40, 19)
  8.     set NewMember to the memberNum of member "navpal"
  9.   end if
  10.   if inside(point(the mouseH, the mouseV), Check) then
  11.     if moving then
  12.       nothing()
  13.     else
  14.       puppetSound(4, "Whoosh")
  15.       tell the stage
  16.         RollWindow("Navigation")
  17.       end tell
  18.       set the memberNum of sprite 1 to NewMember
  19.       set MouseMGR to EMPTY
  20.     end if
  21.   end if
  22. end
  23.  
  24. on MoveMyWindow
  25.   global CatchMouseX, CatchMouseY, moving
  26.   if moving then
  27.     set DeltaX to the mouseH - CatchMouseX
  28.     set DeltaY to the mouseV - CatchMouseY
  29.     tell the stage
  30.       moveWindow("Navigation", DeltaX, DeltaY)
  31.     end tell
  32.   end if
  33. end
  34.  
  35. on NavRoll
  36.   global MouseMGR
  37.   set Myrects to [rect(182, 42, 235, 60), rect(155, 27, 202, 41), rect(114, 30, 152, 49), rect(218, 28, 294, 41), rect(261, 42, 325, 57), rect(69, 43, 112, 59), rect(13, 17, 71, 67)]
  38.   repeat with a = 1 to count(Myrects)
  39.     if inside(point(the mouseH, the mouseV), getAt(Myrects, a)) then
  40.       PurgeWindows()
  41.       sound fadeOut 3
  42.       sound stop 3
  43.       sound fadeIn 3
  44.       tell the stage
  45.         Nav(a)
  46.       end tell
  47.       set MouseMGR to EMPTY
  48.       return 
  49.     end if
  50.   end repeat
  51.   if inside(point(the mouseH, the mouseV), rect(325, 18, 379, 68)) then
  52.     PurgeWindows()
  53.     set MouseMGR to EMPTY
  54.     sound fadeOut 3
  55.     sound stop 3
  56.     sound fadeIn 3
  57.     removewindow("Navigation")
  58.     tell the stage
  59.       quit()
  60.     end tell
  61.   end if
  62. end
  63.  
  64. on mouseDown
  65.   global CatchMouseX, CatchMouseY, moving
  66.   set CatchMouseX to the mouseH
  67.   set CatchMouseY to the mouseV
  68.   if inside(point(the mouseH, the mouseV), rect(41, 0, 344, 25)) then
  69.     set moving to 1
  70.   end if
  71.   set MyTestrects to [rect(10, 23, 68, 70), rect(69, 48, 124, 69), rect(108, 28, 159, 49), rect(165, 31, 214, 47), rect(181, 49, 238, 66), rect(216, 26, 290, 47), rect(258, 49, 325, 68), rect(326, 25, 377, 70)]
  72.   set Myclickedrects to [rect(22, 23, 69, 73), rect(66, 50, 124, 64), rect(107, 35, 156, 50), rect(163, 30, 206, 47), rect(181, 46, 232, 65), rect(214, 34, 292, 49), rect(257, 48, 328, 62), rect(321, 26, 365, 70)]
  73.   set MyClickGRFX to ["homeclck", "timeclck", "stylclck", "millclck", "branclck", "tretclck", "mrktclck", "quitclck"]
  74.   repeat with d = 1 to count(MyTestrects)
  75.     if inside(point(the mouseH, the mouseV), getAt(MyTestrects, d)) then
  76.       puppetSprite(50, 1)
  77.       set the memberNum of sprite 50 to member getAt(MyClickGRFX, d)
  78.       set the rect of sprite 50 to getAt(Myclickedrects, d)
  79.       updateStage()
  80.     end if
  81.   end repeat
  82. end
  83.